Introduction to Software Testing and Analysis (Volume II) by V.K. Jain

Introduction to Software Testing and Analysis (Volume II) by V.K. Jain

Author:V.K. Jain [Jain, V.K.]
Language: eng
Format: epub
Publisher: Atlantic Publishers & Distributors Pvt Ltd
Published: 2018-07-04T23:00:00+00:00


Don’t confuse the relation of objects to classes, on the one hand, with the relation of a base class to derived classes, on the other. Objects which exist in the computer’s memory, embody the exact characteristics of their class, which serves as a design. Derived classes inherit some characteristics from their base class, but add new ones of their own.

Inheritance is somewhat analogous to using functions to simplify a traditional procedural program. If we find that three different sections of a procedural program do almost exactly the same thing, we recognize an opportunity to extract the common elements of these three sections and put them into a single function. The three sections of the program can call the function to execute the common actions, and they can perform their own individual processing as well. Similarly, a base class contains elements common to a group of derived classes. As functions do in a procedural program, inheritance shortens an object-oriented program and clarifies the relationships among program elements.

Inheritance means that one class inherits the characteristics of another class as part of its definition. Inheritance is appropriate when one class is ‘a kind of’ other class (e.g., a is a kind of b-‘text window’ is a kind of ‘window’). These types of hierarchies are fundamental to object-oriented programming. Some classes may inherit from more than one other class, and this is known as ‘multiple inheritance’.

A ‘classification hierarchy’ shows the inheritance relationships between classes, based on the similarities between different classes of objects, Inheritance has two complementary roles:

To allow a class to be extended so that its existing functionality can be built on for new applications.

To allow similar objects to share their common properties and allowed behaviors.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.